<script setup lang="ts">
import {defineExpose, ref} from 'vue'
import { getUserInfo } from "/@/api/login";
import {getObj}from "/@/api/admin/user"
import { FQRID } from '/@/stores/fqrid'
const FQR = FQRID()
const userfrom = ref({})
const getUser = async () => {
  const res = await getUserInfo()
  console.log(res.data.sysUser)
  userfrom.value = res.data.sysUser
}
const getObjFQ = async () => {
  const res = await getObj(FQR.FQid)
  console.log(res);
  userfrom.value = res.data.sysUser
  
}
const getValidateRule = () => {
  console.log('22222')
}
let props = defineProps({
	form: {
		type: Object,
		default: () => {},
	},
  fqlid: {
    type: String,
		default: '',
  }
});
onMounted(() => {
  // getObjFQ()
  setTimeout(() => {
    getObjFQ()
    console.log(FQR.FQid);
  }, 2000);
  const timer = setInterval(() => {
    getObjFQ()
    console.log(props.fqlid);
    console.log(FQR.FQid);
  }, 2000)
  if (userfrom.value) {
    clearInterval(timer)
  }
})


defineExpose({ getValidateRule });

</script>

<template>
<div>
  <div>员工号: {{userfrom.username}}</div>
  <div>单位: {{userfrom.def1}}</div>
  <div>姓名: {{userfrom.name}}</div>
  <div>岗位: {{userfrom.def8}}</div>
</div>
</template>

<style scoped lang="scss">

</style>